/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package almacen.bean;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author Antonio
 */
@Entity
@Table(name = "proveedores", catalog = "bd_almacen", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Proveedores.findAll", query = "SELECT p FROM Proveedores p"),
    @NamedQuery(name = "Proveedores.findByProCodigo", query = "SELECT p FROM Proveedores p WHERE p.proCodigo = :proCodigo"),
    @NamedQuery(name = "Proveedores.findByProDescripcion", query = "SELECT p FROM Proveedores p WHERE p.proDescripcion = :proDescripcion"),
    @NamedQuery(name = "Proveedores.findByProRuc", query = "SELECT p FROM Proveedores p WHERE p.proRuc = :proRuc"),
    @NamedQuery(name = "Proveedores.findByProTelefono", query = "SELECT p FROM Proveedores p WHERE p.proTelefono = :proTelefono"),
    @NamedQuery(name = "Proveedores.findByProCelular", query = "SELECT p FROM Proveedores p WHERE p.proCelular = :proCelular"),
    @NamedQuery(name = "Proveedores.findByProDireccion", query = "SELECT p FROM Proveedores p WHERE p.proDireccion = :proDireccion"),
    @NamedQuery(name = "Proveedores.findByProEmail", query = "SELECT p FROM Proveedores p WHERE p.proEmail = :proEmail"),
    @NamedQuery(name = "Proveedores.findByProObs", query = "SELECT p FROM Proveedores p WHERE p.proObs = :proObs")})
public class Proveedores implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id @GeneratedValue(strategy= GenerationType.SEQUENCE)
    @Basic(optional = false)
    @Column(name = "pro_codigo")
    private Integer proCodigo;
    @Column(name = "pro_descripcion")
    private String proDescripcion;
    @Column(name = "pro_ruc")
    private String proRuc;
    @Column(name = "pro_telefono")
    private String proTelefono;
    @Column(name = "pro_celular")
    private String proCelular;
    @Column(name = "pro_direccion")
    private String proDireccion;
    @Column(name = "pro_email")
    private String proEmail;
    @Column(name = "pro_obs")
    private String proObs;

    public Proveedores() {
    }

    public Proveedores(Integer proCodigo) {
        this.proCodigo = proCodigo;
    }

    public Integer getProCodigo() {
        return proCodigo;
    }

    public void setProCodigo(Integer proCodigo) {
        Integer oldProCodigo = this.proCodigo;
        this.proCodigo = proCodigo;
        changeSupport.firePropertyChange("proCodigo", oldProCodigo, proCodigo);
    }

    public String getProDescripcion() {
        return proDescripcion;
    }

    public void setProDescripcion(String proDescripcion) {
        String oldProDescripcion = this.proDescripcion;
        this.proDescripcion = proDescripcion;
        changeSupport.firePropertyChange("proDescripcion", oldProDescripcion, proDescripcion);
    }

    public String getProRuc() {
        return proRuc;
    }

    public void setProRuc(String proRuc) {
        String oldProRuc = this.proRuc;
        this.proRuc = proRuc;
        changeSupport.firePropertyChange("proRuc", oldProRuc, proRuc);
    }

    public String getProTelefono() {
        return proTelefono;
    }

    public void setProTelefono(String proTelefono) {
        String oldProTelefono = this.proTelefono;
        this.proTelefono = proTelefono;
        changeSupport.firePropertyChange("proTelefono", oldProTelefono, proTelefono);
    }

    public String getProCelular() {
        return proCelular;
    }

    public void setProCelular(String proCelular) {
        String oldProCelular = this.proCelular;
        this.proCelular = proCelular;
        changeSupport.firePropertyChange("proCelular", oldProCelular, proCelular);
    }

    public String getProDireccion() {
        return proDireccion;
    }

    public void setProDireccion(String proDireccion) {
        String oldProDireccion = this.proDireccion;
        this.proDireccion = proDireccion;
        changeSupport.firePropertyChange("proDireccion", oldProDireccion, proDireccion);
    }

    public String getProEmail() {
        return proEmail;
    }

    public void setProEmail(String proEmail) {
        String oldProEmail = this.proEmail;
        this.proEmail = proEmail;
        changeSupport.firePropertyChange("proEmail", oldProEmail, proEmail);
    }

    public String getProObs() {
        return proObs;
    }

    public void setProObs(String proObs) {
        String oldProObs = this.proObs;
        this.proObs = proObs;
        changeSupport.firePropertyChange("proObs", oldProObs, proObs);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (proCodigo != null ? proCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Proveedores)) {
            return false;
        }
        Proveedores other = (Proveedores) object;
        if ((this.proCodigo == null && other.proCodigo != null) || (this.proCodigo != null && !this.proCodigo.equals(other.proCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "almacen.view.Proveedores[ proCodigo=" + proCodigo + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
